Merged
Conversation
zaqquum
approved these changes
Dec 15, 2024
Member
|
저는 테트로미노 문제를 DFS로 풀다 실패해서 브루트포스로 풀었는데 민정님은 DFS로 구현 완료하셨네요 👍 보통 DFS 구현시 종료조건2와 같은 depth체크만하는데 종료조건1을 넣어서 블록 4개를 모두 다 더하지 않은 상황에서도 최댓값이 되지 않을 걸 미리 알고 쳐내는 방식이 흥미로웠습니다. def dfs(x, y, step, total):
# 종료조건1) 탐색을 계속 진행하여도 최댓값에 못 미치는 경우
if total + max_val*(4-step) <= answer:
return
# 종료조건2) 블록 4개를 모두 활용한 경우
if step == 4:
answer = max(answer, total)
return |
YoonYn9915
approved these changes
Dec 15, 2024
Collaborator
Author
|
@YoonYn9915 어쩐지 제출할 때 엄청 느리게 채점되더라구요.. 이 문제는 DFS 보다는 완전탐색 문제였던 것 같아요! 추가적인 블로그도 공유해주시고, 구체적인 피드백 감사합니다!! |
learntosurf
approved these changes
Dec 15, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌱WIL
🚀주간 목표 문제 수: 4개
백준 #11660. 구간 합 구하기 5 : DP / 실버1
🚩플로우 (선택)
N, 쿼리 수M입력받는다.grid배열 생성한다.prefix_sum[i][j]를 점화식을 통해 계산한다.🚩제출한 코드
💡TIL
백준 #10844. 쉬운 계단 수: DP / 실버1
🚩제출한 코드
💡TIL
백준 #1914. 하노이탑: DP / 실버1
🚩제출한 코드
💡TIL
백준 #14500. 테트로미노: 구현 / 골드4
🚩플로우 (선택)
🚩제출한 코드
💡TIL
이 문제를 통해 DFS 탐색과 예외 처리의 중요성을 다시 한번 깨달았다.